<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<script type="text/javascript">
function slideSwitch() {
    var $active = $("#slideshow DIV.active");
 
    if ( $active.length == 0 ) $active = $('#slideshow DIV:last');
    var $next =  $active.next().length ? $active.next()
        : $("#slideshow DIV:first");
    // uncomment below to pull the divs randomly
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 200, function() {
            $active.removeClass('active last-active');
        });
}
$(function() {
    setInterval( "slideSwitch()", 3500 );
});
</script> 
<?php
$noibat = mysql_query("SELECT id,name,name_rewrite,url_hinh,description,menu_id FROM info WHERE `delete`=0 AND status=1 AND `other`=1 AND menu_id NOT LIKE '%,2,%' AND menu_id NOT LIKE '%,7,%' ORDER BY date_update DESC LIMIT 9");
$i = 0;
$echo = '<div id="noibat"><div id="slideshow">';
while($row = mysql_fetch_array($noibat)){
	$i++;
	$url_link = $tc->link_detail($row['menu_id']);
	if($i==1){
		$echo .= '<div class="active"><a href="'.$url_link.$row['name_rewrite'].'.html"><img width="350px" src="upload/images/info/'.$row['url_hinh'].'" alt="'.$row['name'].'" /><h1>'.$row['name'].'</h1></a><p>'.$row['description'].'</p></div>';
		$echo2 .= '<div><a href="'.$url_link.$row['name_rewrite'].'.html"><img width="100" height="65" src="upload/_thumbs/Images/info/'.$row['url_hinh'].'" alt="'.$row['name'].'" /><span>'.$row['name'].'</span></a></div>';
	}else if($i < 6){
		$echo .= '<div><a href="'.$url_link.$row['name_rewrite'].'.html"><img width="350px" src="upload/images/info/'.$row['url_hinh'].'" alt="'.$row['name'].'" /><h1>'.$row['name'].'</h1></a><p>'.$row['description'].'</p></div>';
		$echo2 .= '<div><a href="'.$url_link.$row['name_rewrite'].'.html"><img width="100" height="65" src="upload/_thumbs/Images/info/'.$row['url_hinh'].'" alt="'.$row['name'].'" /><span>'.$row['name'].'</span></a></div>';
	}else{
		$tintuc .= '<div class="item"><a href="'.$url_link.$row['name_rewrite'].'.html"><img src="upload/images/info/'.$row['url_hinh'].'" alt="'.$row['name'].'" /><h2>'.$row['name'].'</h2></a><p>'.$row['description'].'</p></div>';
	}
}
$echo .= '</div></div>';
echo $echo.'<div id="noibat2">'.$echo2.'</div>';

/*video*/
$noibat = mysql_query("SELECT id,name,name_rewrite,link_video,menu_id FROM video WHERE `delete`=0 AND status=1 AND `other`=1 ORDER BY date_update DESC LIMIT 4");
$echo = '<div id="noibat3">';
$g=0;
while($row = mysql_fetch_array($noibat)){
	$g++;
	$url_link = $tc->link_detail($row['menu_id']);
	if($g==1){
		$echo .= '<iframe src="'.$row['link_video'].'?origin=www.hongcuongclub.com&rel=0" frameborder="0"></iframe><a href="'.$url_link.$row['name_rewrite'].'.html"><h3>'.$row['name'].'</h3></a>';
	}else{
		$echo .= '<p><a href="'.$url_link.$row['name_rewrite'].'.html">'.$row['name'].'</a></p>';
	}
}
echo $echo.'</div><div style="clear:both; height:40px"></div>';
/*tin tuc si kien*/
$echo = '<div id="xeco"><div style="text-align:center; width:100%; margin-bottom:15px;"><img src="images/title1.gif" alt="" /> <span style="color:#3f0102; font-size:26px"> &nbsp; <strong>TIN TỨC SỰ KIỆN</strong> &nbsp; </span> <img src="images/title2.gif" alt="" /></div>'.$tintuc.'</div><div style="clear:both; height:40px"></div>';
echo $echo;
/*xe co*/
$echo = '<div id="xeco"><div style="text-align:center; width:100%; margin-bottom:15px;"><img src="images/title1.gif" alt="" /> <span style="color:#3f0102; font-size:26px"> &nbsp; <strong>XE CỔ</strong> &nbsp; </span> <img src="images/title2.gif" alt="" /></div>';
$noibat = mysql_query("SELECT id,name,name_rewrite,url_hinh,description,menu_id FROM info WHERE `delete`=0 AND status=1 AND `other`=1 AND menu_id LIKE '%,".dmxeco.",%' ORDER BY date_update DESC LIMIT 4");
while($row = mysql_fetch_array($noibat)){
	$url_link = $tc->link_detail($row['menu_id']);
	$echo .= '<div class="item"><a href="'.$url_link.$row['name_rewrite'].'.html"><img src="upload/images/thuvien_xeco/'.$row['url_hinh'].'" alt="'.$row['name'].'" /><h2>'.$row['name'].'</h2></a><p>'.$row['description'].'</p></div>';
}
echo $echo.'</div><div style="clear:both; height:40px"></div>';
?>